<!doctype html>
<html>

<head>
	<meta charset="utf-8">
	<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
	<meta name="format-detection" content="telephone=no" />
	<title>首页</title>
	<link rel="stylesheet" type="text/css" href="../c/aui.css" />
	<link rel="stylesheet" type="text/css" href="../c/animate.css" />
	<style>
		body {
		background-color:transparent;
		}
		/*签到窗口*/
		#t{
			position: fixed;
			top: 0;
			width: 100%;
			height: 100%;
			left:0;
			background-color:rgba(0,0,0,0.8);
			z-index: 1
		}
		#qiandao_msg {
			width: 100%;
			position: fixed;
			top: 50%;
			left: 50%;
			-moz-transform: translate(-50%, -50%);
			-ms-transform: translate(-50%, -50%);
			-webkit-transform: translate(-50%, -50%);
			transform: translate(-50%, -50%);
			z-index: 2;
		}
		#qiandao_msg .img{
			width: 15rem;
			margin: 0 auto;
		}
		#qiandao_msg img#zhuli {
			margin: 0 auto;
			width: 100%;
		}

		#qiandao_msg #text {
			position: absolute;
			top: 0rem;
			text-align: center;
			margin: 0 auto;
			width: 100%;
			color: #fff;
			padding-top: 15%;
			z-index: 1;
		}

		#qiandao_msg #text p.b {
			font-size: 1rem;
			color: #fff;
		}

		#qiandao_msg #text p.b b {
			font-size: 1.5rem;
		}

		#qiandao_msg p {
			color: #fff;
			font-size: 0.7rem;
			padding-top: 0.5rem
		}

		#qiandao_msg .btn {
			position: relative;
			text-align: center;
			width: 100%;
			padding-top:0rem;
		}

		#qiandao_msg .sx-btn {
			width: 60%;
			background: #e51c23;
			text-align: center;
			padding: 0.35rem 0;
			border-radius: 1rem;
			margin: 0.3rem auto;
		}

		#qiandao_msg .btn .p {
			font-size: 0.65rem;
			opacity: 0.7
		}

		#qiandao_msg .btn .x {
			width: 1.3rem;
			text-align: center;
			margin: 0 auto;
			margin-top: 2rem;
		}
		/*#qiandao_msg img#zhuli{
			width: 65%;
		}*/
		.img{
			position: relative;
		}
		.img .text{
			position: absolute;
			top: 0;
			left: 0;
			right: 0;
			text-align: center;
			padding-top: 5rem;
			color: #cb3536;
			font-size: 0.65rem;
		}
		.img .text b{
			color: #cb3536;
			font-size:2.5rem;
		}
		.img .text .p{
			margin-top: -0rem;
			font-size: 0.65rem;
		}
		.xiamian{
			position: absolute;
			bottom: 0;
			left: 0;
			right:0;
			/*margin-bottom: 3rem;*/
		}
		.xiamian .jindu{
			position: relative;
			width: 8rem;
			margin: 0 auto;
		}
		.xiamian .p{
			background:#fbc388;
			display: inline-block;
			float: right;
			color: #c8292e;
			border-radius: 0.75rem;
			padding: 0.1rem 0.35rem;
			text-align: center;
			font-size: 0.55rem;
			margin-bottom: 0.25rem;
		}
		.jindu .aui-progress{
			border-radius: 20rem;
			height: 0.25rem;
			background: rgba(255, 255, 255, 0.3);
		}
		.jindu .aui-progress-bar{
			background-image: linear-gradient(to right,rgba(251, 154, 93, 1), rgba(243, 198,177, 1));
			-webkit-transition:all 1s
		}
		.xiamian .p2{
			font-size: 0.6rem;
			color: #fbc388;
			text-align: center;
			padding: 0.5rem 0;
		}
		.fenxiang{
			width: 11rem;
			text-align: center;
			margin: 0 auto;
			padding-bottom: 1.5rem;
			padding-top: 0.5rem;
		}
		.an img.png{
			text-align: center;
			height: 2.2rem;
			width: 100%;
		}
		.an{
			position: relative;
		}
		.an div{
			display: flex;
			justify-content: center;
			align-items: center;
			color: #cb3536;
			position: absolute;
			top: 0;
			left: 0;
			padding-top: 0.5rem;
			text-align: center;
			width: 100%;
			font-size: 0.85rem;
			font-weight: bold;
		}
		#qiandao_msg .an div img{
			width: 1.2rem;
			margin-right: 0.25rem;
		}
	</style>
</head>

<body>
	<div id="t"></div>
	<div id="qiandao_msg" class="zhuli">
		<div class="animated bounceIn">
			<div class="img">
				<img  src="../i/hongbao/index_0.png" id="zhuli"  tapmode onclick="a()" />
			</div>
			<div class="btn">
				<div class="x" tapmode onclick="x()"><img src="../i/x.png" /></div>
			</div>
		</div>
	</div>
</body>
<script type="text/javascript" src="../j/api.js"></script>
<script type="text/javascript">
	apiready = function() {
		console.log(Math.floor(Math.random()*10))
		$('#zhuli').attr('src',"../i/hongbao/index_"+Math.floor(Math.random()*5)+".png")
		// api.setFrameAttr({
		// 		name: 'hongbao_icon',
		// 		hidden: true
		// });
		// api.execScript({
		//     frameName: 'scrollVideo',
		//     script: 'scrollVideo.pause();'
		// });
	}
	function x(){
		if(_getPrefs('_user')){
			_setPrefs('hongbao_open', '1');
		}else{
			api.execScript({
			    frameName: 'suxiangw_com',
			    script: 'hongbao(1);'
			});
		}
		api.setFrameAttr({
				name: 'hongbao_icon',
				hidden: false
		});
		// api.execScript({
		//     frameName: 'scrollVideo',
		//     script: 'scrollVideo.play();'
		// });
		api.closeFrame();
	}
	var ajax = false;
	function a(){
			if(!_getPrefs('_user')){
				return _login();
			}
			_url({},'hongbao',true);
			x();
			return;
			if(ajax){
				return _msg('请稍候');
			}
			_loading();
			ajax = true;
			$('.text img').addClass('donghua');
			_ajax('renwu/hongbao_user',function(ret,err){
				_loadingCloes();
				if(ret){
					if(ret.ret || ret.err == '请重新打开页面'){
						// api.execScript({
						// 		script: 'data();'
						// });
						// setTimeout(function(){
						// 	tan(ret.ret);
						// },1000)
						return;
					}else{
						_msg(ret.err);
					}
				}else {
					_alert(JSON.stringify(err))
				}
				ajax = false;
			})
	}
</script>

</html>
